import QtQuick 2.6
import QtQuick.Layouts 1.3
import Qt.labs.controls 1.0
import "../template" as Template
Template.PopupFrame {
    id:view

    signal callback (string date, string name, string mobile, string time, string description)

    property alias date: labelDate.text
    property alias mobile: labelMobile.text
    title: "约车"
    contentHeight: 420
    Pane {
        ColumnLayout {
            id: col
            anchors.fill: parent
            anchors.margins: 9
            spacing: 12
            RowLayout {
                Label {id: labelText; font.pixelSize: 14; text: "日期："}

                TextField {
                    id: labelDate

                    Layout.alignment: Qt.AlignVCenter

                    Layout.fillWidth: true
                    readOnly: true
                }
            }
            RowLayout {
                Label {font.pixelSize: 14; text: "姓名："}

                TextField {
                    id: labelName

                    Layout.alignment: Qt.AlignVCenter

                    Layout.fillWidth: true
                    readOnly: true
                    text: usinfo.name
                }
            }

            RowLayout {
                Label {font.pixelSize: 14; text: "电话："}

                TextField {
                    id: labelMobile

                    Layout.alignment: Qt.AlignVCenter

                    Layout.fillWidth: true
                }

            }

            RowLayout {
                Label { font.pixelSize: 14; text: "时间："}

                ComboBox {
                    id: tum1
                    model: ["06", "07", "08", "09","10", "13", "14", "15","16"]
                    Layout.preferredWidth: 96
                }
                Label {text: "点"}
                ComboBox {
                    id: tum2
                    model: ["00", "30"]
                    Layout.preferredWidth: 96
                }
                Label {text: "分"}


            }

            RowLayout {
                Label {font.pixelSize: 14; text: "说明："}

                TextField {
                    id: labelDescription

                    Layout.alignment: Qt.AlignVCenter

                    Layout.fillWidth: true
                }

            }

        }
    }

    onClicked: {
        callback(labelDate.text,labelName.text,
                 labelMobile.text,
                 tum1.model[tum1.currentIndex] + ":" + tum2.model[tum2.currentIndex]
                 , labelDescription.text)
        view.close()
    }
//    footer:  ToolBar{
//        leftPadding: 1
//        rightPadding: 1
//        bottomPadding: 1
//        Row {anchors.fill: parent

//            Button {
//                text: "取消"
//                width: parent.width /2
//                onClicked: {
//                    view.close()
//                }
//            }

//            Button {
//                text: "确定"

//                width: parent.width /2
//            }
//        }
//    }
}

